package com.um.swing.common.inc;

import com.um.swing.component.JImagePane;

import java.awt.*;

/**
 * destop clock create factory calss.
 *
 * @author chenxin <chenxin619315@gmail.com>
 */
public class CreateCursor {
    public static Cursor createIcon(String filename) {
        Toolkit toolkit = Toolkit.getDefaultToolkit(); //得到默认的ToolKit对象
        Image image = toolkit.getImage(JImagePane.class.getResource("/cur/" + filename + ".png")); //得到图像
        return toolkit.createCustomCursor(image, new Point(12, 8), filename+"Cursor"); //实例化自定义光标对象
    }
}
